<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script src="jiandan.js"></script>

  <script>

    let a = new HD((resolve, reject) => {
      // resolve('hha');
      reject('111')
    })
    a.then(null, err => {
      console.log(err);
    })
    let ooo = new HD((resolve, reject) => {
      // resolve('hha');
      resolve('222')

    })
    console.log(a);
    console.log(ooo);
    ooo.then(res => {
      console.log(res);
    })


    let z = new HD((resolve, reject) => {
      resolve('3333')
    })
    z.then(res => {
      console.log(res);
      return new HD((resolve) => {
        resolve('哈哈哈哈哈')
      })
    }).then(res => {
      console.log(res);
    })
  </script>
</body>

</html>